package com.neoCalf.neoCommon.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;


/**
 * Description 用户信息
 * date 2024-08-28 12:49:24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user_info")
public class UserInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 用户ID
     */
    @TableId(value = "user_id")
    private String userId;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 头像
     */
    private String avatar;
    /**
     * 微信ID
     */
    private String openId;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 昵称
     */
    private String nickName;
    /**
     * 0:直接添加 1:同意后添加
     */
    private Integer joinType;
    /**
     * 角色 admin:管理员 user:普通用户
     */
    private String role;
    /**
     * 0:女 1男
     */
    private Integer sex;
    /**
     * 密码
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String password;
    /**
     * 个性签名
     */
    private String personalSignature;
    /**
     * 状态
     */
    private Integer status;
    /**
     * 创建时间
     */
    private Long createTime;
    /**
     * 最后一次登录时间
     */
    private Long lastLoginTime;
    /**
     * 地区
     */
    private String areaName;
    /**
     * 地区编号
     */
    private String areaCode;
    /**
     * 退出登录时间
     */
    private Long lastOffTime;

    public UserInfo(String userId, String email, String nickName, Integer joinType, String avatar) {
        this.userId = userId;
        this.email = email;
        this.nickName = nickName;
        this.joinType = joinType;
        this.avatar = avatar;
    }
}